<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="/Public/Admin/css/base.css"/>
    <link rel="stylesheet" href="/Public/Admin/css/info-mgt.css"/>
    <link rel="stylesheet" href="/Public/Admin/css/WdatePicker.css"/>
    <title>移动办公自动化系统</title>
</head>

<body>
<div class="title"><h2>信息管理</h2></div>
<div class="table-operate ue-clear">
    <a href="javascript:;" class="add">添加</a>
    <a href="javascript:;" class="del">删除</a>
    <a href="javascript:;" class="edit">编辑</a>
    <a href="javascript:;" class="count">统计</a>
    <a href="javascript:;" class="check">审核</a>
</div>
<div class="table-box">
    <form action="">

        <table>
            <thead>
            <tr>
                <th class="num"></th>
                <th class="num">序号</th>
                <th class="name">部门</th>
                <th class="process">所属部门</th>
                <th class="node">排序</th>
                <th class="time">备注</th>
                <th class="operate">操作</th>
            </tr>
            </thead>
            <tbody>

            <?php if(is_array($mDatas)): $i = 0; $__LIST__ = $mDatas;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                    <td class="cb" align="center">
                        <input type="checkbox" class="checkbox" align="center" value="<?php echo ($vo["id"]); ?>"/>
                    </td>
                    <td class="num"><?php echo ($vo["id"]); ?></td>

                    <td class="name"><?php echo (str_repeat('&nbsp;',$vo["level"]*2)); echo ($vo["name"]); ?></td>

                    <?php if(is_array($mDatas)): $i = 0; $__LIST__ = $mDatas;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$voo): $mod = ($i % 2 );++$i;?><!--<?php echo ($vo["pid"]); ?>-&#45;&#45; <?php echo ($voo["id"]); ?>-&#45;&#45;<br> <?php echo U('edit');?>/id/<?php echo ($vo["id"]); ?> --><?php endforeach; endif; else: echo "" ;endif; ?>
                    <td class="process">
                        <?php if($vo["pid"] == 0): ?>顶级部门
                            <?php else: ?>
                            <?php echo ($vo["deptname"]); endif; ?>
                    </td>
                    <td class="node"><?php echo ($vo["sort"]); ?></td>
                    <td class="time"><?php echo ($vo["remark"]); ?></td>
                    <td class="operate"><a href="/index.php/Admin/Dept/edit/id/<?php echo ($vo["id"]); ?>">编辑&nbsp|&nbsp</a>
                        <a href="#" onClick="return disp_confirm('<?php echo ($vo["id"]); ?>')">删除</a>
                    </td><!--removeFromCart('${item.product.pid}')-->
                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>
    </form>
</div>
<div class="pagination ue-clear"></div>
</body>
<script type="text/javascript" src="/Public/Admin/js/jquery.js"></script>
<script type="text/javascript" src="/Public/Admin/js/common.js"></script>
<script type="text/javascript" src="/Public/Admin/js/WdatePicker.js"></script>
<script type="text/javascript" src="/Public/Admin/js/jquery.pagination.js"></script>
<script type="text/javascript">
    $(".select-title").on("click", function () {
        $(".select-list").hide();
        $(this).siblings($(".select-list")).show();
        return false;
    })
    $(".select-list").on("click", "li", function () {
        var txt = $(this).text();
        $(this).parent($(".select-list")).siblings($(".select-title")).find("span").text(txt);
    })

    $('.pagination').pagination(100, {
        callback: function (page) {
            alert(page);
        },
        display_msg: true,
        setPageNo: true
    });

    $("tbody").find("tr:odd").css("backgroundColor", "#eff6fa");

    showRemind('input[type=text], textarea', 'placeholder');

    function disp_confirm(id) {
        if (confirm("你确定要删除?")) {
            // alert('/index.php/Admin/Dept/delete/id/' + id);
            location.href = "/index.php/Admin/Dept/delete/id/" + id;
        }
    }

    $(function () {
        $('.del').on('click', function () {

            var number = '';

            $('input:checkbox:checked').each(function (k) {
                if (k == 0) {
                    number = $(this).val();
                } else {
                    number += ',' + $(this).val();
                }
            });
            location.href = "/index.php/Admin/Dept/delete/id/" + number;
        });
    });

</script>

</html>